package rhc.spider.util;

import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

/**定时运行,用于爬虫新url调度抓取
 * @author lenovo1
 *
 */
public class ScheduledThreadUtil {

	/**
	 * 需要定时重新运行的任务
	 */
	private static final Set<Runnable> SCHEDULE_THREAD=new HashSet<Runnable>();
	
	private static final ScheduledExecutorService scheduledThreadPool = Executors.newScheduledThreadPool(1);
	
	/**加入一个新的
	 * @param runnable
	 */
	public void addNewSchedule(Runnable runnable){
		SCHEDULE_THREAD.add(runnable);
	}
}
